{% extends 'static_base.html' %}
{% load static %}
{% block title %} 天天生鲜-首页 {% endblock title %}
{% block topfiles %}
	<script type="text/javascript" src="{% static 'js/jquery-1.12.4.min.js' %}"></script>
	<script type="text/javascript" src="{% static 'js/jquery-ui.min.js' %}"></script>
	<script type="text/javascript" src="{% static 'js/slide.js' %}"></script>
{% endblock topfiles %}

{% block body %}

	<div class="navbar_con">
		<div class="navbar">
			<h1 class="fl">全部商品分类</h1>
			<ul class="navlist fl">
				<li><a href="{% url 'goods:index' %}">首页</a></li>
				<li class="interval">|</li>
				<li><a href="">手机生鲜</a></li>
				<li class="interval">|</li>
				<li><a href="">抽奖</a></li>
			</ul>
		</div>
	</div>

	<div class="center_con clearfix">
		<ul class="subnav fl">
			{% for goodsType in goodsTypes %}
				<li><a href="#model0{{ forloop.counter }}" class="{{ goodsType.logo }}">
					{{ goodsType.name }}</a></li>
			{% endfor %}
		</ul>
		<div class="slide fl">
			<ul class="slide_pics">
				{% for banner in indexGoodsBannner %}
					<li><img src="{{ banner.image.url }}" alt="幻灯片"></li>
				{% endfor %}
			</ul>
			<div class="prev"></div>
			<div class="next"></div>
			<ul class="points"></ul>
		</div>
		<div class="adv fl">
			{% for promotionBanner in indexPromotionBanner %}
				<a href="{{ promotionBanner.url }}"><img src="{{ promotionBanner.image.url }}"></a>
			{% endfor %}
		</div>
	</div>
	{% for type in goodsTypes %}
		<div class="list_model">
			<div class="list_title clearfix">
				<h3 class="fl" id="model01">{{ type.name }}</h3>
				<div class="subtitle fl">
					<span>|</span>
					{% for title in type.titles %}
						<a href="#">{{ title.sku.name }}</a>
					{% endfor %}
				</div>
				<a href="#" class="goods_more fr" id="fruit_more">查看更多 ></a>
			</div>

			<div class="goods_con clearfix">
				<div class="goods_banner fl">
					<img src="{{ type.image.url }}">
				</div>
				<ul class="goods_list fl">
					{% for banner in type.bannars %}
						<li>
							<h4><a href="#">{{ banner.sku.name }}</a></h4>
							<a href="#"><img src="{{ banner.sku.image.url }}"></a>
							<div class="prize">¥ {{ banner.sku.price }}</div>
						</li>
					{% endfor %}
				</ul>
			</div>
		</div>
	{% endfor %}

{% endblock body %}
{% block buttomfiles %}
	<script type="text/javascript" src="js/slideshow.js"></script>
	<script type="text/javascript">
		BCSlideshow('focuspic');
		var oFruit = document.getElementById('fruit_more');
		var oShownum = document.getElementById('show_count');

		var hasorder = localStorage.getItem('order_finish');

		if(hasorder)
		{
			oShownum.innerHTML = '2';
		}

		oFruit.onclick = function(){
			window.location.href = 'list.html';
		}
	</script>
{% endblock buttomfiles %}